package com.hy.controller;


import com.hy.Result.ResponseResult;
import com.hy.service.SetMealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/setmeal")
public class SetMealController {
    @Autowired
    private SetMealService setMealService;

    /**
     * 客户端套餐查询
     * @return Result
     */
    @RequestMapping("/getAllSetMeal")
    public ResponseResult getAllSetMeal(){
        try {
            return setMealService.getAllSetMeal();
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseResult.errorResult(400, "查询失败!"+e.getMessage());
        }
    }

    /**
     * 根据套餐id查询检查组检查项
     * @param setmealId 套餐id
     * @return Result
     */
    @RequestMapping("/getCheckGroupItemBySetmealId")
    public ResponseResult getCheckGroupItemBySetmealId(@RequestParam("setmealId") Integer setmealId){
        try {
            return setMealService.getCheckGroupItemBySetmealId(setmealId);
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseResult.errorResult(400, "查询失败!"+e.getMessage());
        }
    }




}



























